<?php

namespace app\core\exception;

class BusinessException extends \RuntimeException
{

    public function __construct($code, $message = '', \Throwable $previous = null)
    {
        if (empty($message)) {
            $message = !empty(ErrorCode::ERROR_MSG[$code]) ? ErrorCode::ERROR_MSG[$code] : $message;
        }
        parent::__construct($message, $code, $previous);
    }

}
